<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ include file="/FInclude/includeTaglibs.jsp"%>
<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
<link rel="stylesheet" href="${frontPath}/style/ckeditor.plugin.css" />
<c:import url="/FInclude/backEndCssJs.jsp" />
<script type="text/javascript"
	src="${frontPath}/js/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="${frontPath}/js/ckeditor.plugin.js"></script>
<script src="${frontPath}/js/DatePicker/WdatePicker.js"></script>
<style type="text/css">
.row {
	margin-top: 15px;
}
</style>
</head>
<body>
	<form action="add.json" method="post" onsubmit="return false;">
	<div class="container-fluid">
		<div class="panel panel-default">
			<div class="row">
				<div class="input-group">
					<button class="form-control" onclick="history.back();">返回</button>
				</div>
				<div class="input-group">
					<span class="input-group-addon">图片</span>
					<img src="">
					<input type="file" style="width:80px" name="file">
					<input name="pic" type="hidden" >
				</div>
				<div class="input-group">
					<input type="submit" class="form-control" a>
				</div>
			</div>
		</div>
	</div>
	</form>
	<script>
	$("input[type=file]").change(function(){
		$(this).uploadFile("../../file/banner.json",{},function(data){
			$("div img").attr("src", $.frontPath + data.url);
			$("input[name=pic]").val(data.url);
		});
	});
	
	$("input[type=submit]").click(function(){
		$("form").postData(
				$("form").attr("action"),
				{},
				function(data){
					$.box("添加成功",function(){
						location.href = "list";
					});
		});
	});
</script>
	<table width="460" border="0" cellspacing="0" cellpadding="0"
		style="display:none" id="dd">
		<tbody>
			<input class="text1 w200" type="hidden" name="pic1">
			<tr>
				<td width="40" height="60">&nbsp;</td>
				<td colspan="2">
					<div class="changeImg">
						<input type="file" name="pic">
					</div>
				</td>
			</tr>
			<tr>
				<td width="40" height="24">&nbsp;</td>
				<td colspan="2">
					<div class="theImg" id="imgDiv"></div>
				</td>
			</tr>
		</tbody>
	</table>
</body>
</html>